﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using System.Web.Script.Serialization;
using System.Text;

namespace eDoc.Handler
{
    /// <summary>
    /// Summary description for checklogin
    /// </summary>
    public class checklogindownload : IHttpHandler, IRequiresSessionState
    {

        public void ProcessRequest(HttpContext context)
        {
            int login = -1; //-1: chua login; 0: sai user; 1: sai pass; 2: sai uidi

            if (context.Request.Params["u"] != null && context.Request.Params["p"] != null)
            {

            }
            
            CheckLogin check = new CheckLogin();
            check.Login = login;

            string str = "";
            JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
            str = jsSerializer.Serialize(check);
            context.Response.ContentType = "application/x-javascript";
            context.Response.ContentEncoding = Encoding.UTF8;
            context.Response.Write(str);
        }


        private string ReturnData()
        {
            string result = "";

            return result;
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }

        public class CheckLogin
        {
            public int Login
            {
                get;
                set;
            }
        }
    }
}